package com.gxa.web_admin.controller;

import com.gxa.common.base.RespResult;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


//这个类是spring的全局异常，捕获处理
@ControllerAdvice
public class EX {

   final String msg = "你没有权限访问！！！！！";
//    无权限的访问接口！！！
    @ResponseBody
    @ExceptionHandler(value = AuthorizationException.class)
    public RespResult nogurisdiction() {
        return RespResult.success(msg);


    }
}